/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package job.manager.db.ec;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "TimeSchedule")
@NamedQueries({@NamedQuery(name = "TimeScheduleEB.findAll", query = "SELECT t FROM TimeScheduleEB t"), @NamedQuery(name = "TimeScheduleEB.findById", query = "SELECT t FROM TimeScheduleEB t WHERE t.id = :id"), @NamedQuery(name = "TimeScheduleEB.findByMinSalary", query = "SELECT t FROM TimeScheduleEB t WHERE t.minSalary = :minSalary")})
public class TimeScheduleEB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "minSalary")
    private int minSalary;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "timeScheduleId")
    private Collection<JobEB> jobEBCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "timeScheduleId")
    private Collection<ProfileJobMapperEB> profileJobMapperEBCollection;
    @JoinColumn(name = "startid", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private TimeScheduleRowEB startid;
    @JoinColumn(name = "endId", referencedColumnName = "id")
    @ManyToOne
    private TimeScheduleRowEB endId;

    public TimeScheduleEB() {
    }

    public TimeScheduleEB(Integer id) {
        this.id = id;
    }

    public TimeScheduleEB(Integer id, int minSalary) {
        this.id = id;
        this.minSalary = minSalary;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getMinSalary() {
        return minSalary;
    }

    public void setMinSalary(int minSalary) {
        this.minSalary = minSalary;
    }

    public Collection<JobEB> getJobEBCollection() {
        return jobEBCollection;
    }

    public void setJobEBCollection(Collection<JobEB> jobEBCollection) {
        this.jobEBCollection = jobEBCollection;
    }

    public Collection<ProfileJobMapperEB> getProfileJobMapperEBCollection() {
        return profileJobMapperEBCollection;
    }

    public void setProfileJobMapperEBCollection(Collection<ProfileJobMapperEB> profileJobMapperEBCollection) {
        this.profileJobMapperEBCollection = profileJobMapperEBCollection;
    }

    public TimeScheduleRowEB getStartid() {
        return startid;
    }

    public void setStartid(TimeScheduleRowEB startid) {
        this.startid = startid;
    }

    public TimeScheduleRowEB getEndId() {
        return endId;
    }

    public void setEndId(TimeScheduleRowEB endId) {
        this.endId = endId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TimeScheduleEB)) {
            return false;
        }
        TimeScheduleEB other = (TimeScheduleEB) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "job.manager.db.ec.TimeScheduleEB[id=" + id + "]";
    }

}
